function contentPrepare($)
{
  var setPhoto = function(e, filename, type)
  {
    $.post(
      [$.baseUrl, "/user/update"].join(""),
      {"field": "photo", "value": filename, "type": type || "photo"},
      function(response){if(response.src)$("#user-photo,#profile").find("img").attr("src",response.src);}
    );
  };

// правка профиля
  $("#user-photo").
    find("img.change-photo").uploader({title : "Загрузить фотографию", url: [$.baseUrl, "/content/imgupload/photos"].join("")}).
    bind("upload", setPhoto).
    end().
    find("a").avatars({contentElement: "#user-profile"}).bind("avaselect", function(e, filename)
    {
      $("#user-photo img.change-photo").uploader("setSrc", "");
      setPhoto(e, filename, "avatar");
    });
  $("#content .user-profile").
    each(function(){with($(this))if(!text())hide();}).
    find(".change-text").each(function()
    {
      with ($(this))
        changeText({
          "url"        : [$.baseUrl, "/user/update"].join(""),
          "fieldAttr"  : "data-contact",
          "linkElement": ["#contact-", " .contact-field"].join(data("contact"))
        });
    });
}
